package com.tongtech.system.domain;

import com.tongtech.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 资讯分类表 information_category
 *
 * @author xingyc
 */
public class InformationCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 资讯分类ID */
    private Long infoCategoryId;

    /** 资讯唯一code */
    private String categoryCode;

    /** 父资讯分类ID */
    private Long parentId;

    /** 祖级列表 */
    private String ancestors;

    /** 资讯分类名称 */
    private String categoryName;

    /** 显示顺序 */
    private Integer orderNum;

    /** 资讯分类状态:0正常,1停用 */
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 父资讯分类名称 */
    private String parentName;

    /** 子资讯分类 */
    private List<InformationCategory> children = new ArrayList<InformationCategory>();

    public Long getInfoCategoryId() {
        return infoCategoryId;
    }

    public void setInfoCategoryId(Long infoCategoryId) {
        this.infoCategoryId = infoCategoryId;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getParentId()
    {
        return parentId;
    }

    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public String getAncestors()
    {
        return ancestors;
    }

    public void setAncestors(String ancestors)
    {
        this.ancestors = ancestors;
    }

    @NotNull(message = "显示顺序不能为空")
    public Integer getOrderNum()
    {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum)
    {
        this.orderNum = orderNum;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getParentName()
    {
        return parentName;
    }

    public void setParentName(String parentName)
    {
        this.parentName = parentName;
    }

    public List<InformationCategory> getChildren()
    {
        return children;
    }

    public void setChildren(List<InformationCategory> children)
    {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("infoCategoryId", getInfoCategoryId())
            .append("categoryCode", getCategoryCode())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("categoryName", getCategoryName())
            .append("orderNum", getOrderNum())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
